package com.iv.durian.cloud.facade;

import com.iv.durian.cloud.Content;
import com.iv.durian.cloud.Coverage;
import com.iv.durian.cloud.Serve;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * Created by LiuLin on 2018/6/30 0030.
 */
@Component
@FeignClient(name = Serve.SERVICE_NAME)
@RequestMapping("/service/coverage")
public interface CoverageFacade {
    @RequestMapping(value = "/list/{type}", method = RequestMethod.GET)
    List<Coverage> list(@PathVariable("type") Integer type);

    @RequestMapping(value = "/get/{coverageId}", method = RequestMethod.GET)
    Coverage get(@PathVariable("coverageId") Integer coverageId);

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    void add(@RequestBody Coverage coverage);

    @RequestMapping(value = "/remove/{coverageId}", method = RequestMethod.GET)
    int remove(@PathVariable("coverageId") Integer coverageId);

    @RequestMapping(value = "/count/{type}", method = RequestMethod.GET)
    int count(@PathVariable("type") Integer type);

    @RequestMapping(value = "/update", method = RequestMethod.POST)
    void update(@RequestBody Coverage coverage);

    @RequestMapping(value = "/get/content/{coverageId}", method = RequestMethod.GET)
    Content getContent(@PathVariable("coverageId") Integer coverageId);

    @RequestMapping(value = "/update/content", method = RequestMethod.POST)
    void updateContent(@RequestBody Content content);
}
